package com.xhs.zdl.demo.itemHasImageOrVideo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ExpandableListView;

import com.xhs.zdl.demo.R;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class PakeUpImgVideoActivity extends AppCompatActivity {

    private ExpandableListView expandableListView;
    private ArrayList<String> parent;
    private HashMap<String, List<String>> child;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pake_up_img_video);

        findView();
        initView();
    }

    private void initView() {
        parent = new ArrayList<>();
        child = new HashMap<>();

        List<String> list = new ArrayList<>();
        list.add("http://oznuanmqa.bkt.clouddn.com/1511088846.png");
        list.add("http://oznuanmqa.bkt.clouddn.com/1511088989.png");
        child.put("parent", list);
        parent.add("parent");


        expandableListView.setAdapter(new ExpandableListViewAdapter(this, parent, child));
        expandableListView.setOnChildClickListener(onChildClickListener);
    }

    private void findView() {
        expandableListView = (ExpandableListView) findViewById(R.id.pake_up_img_video);
    }

    ExpandableListView.OnChildClickListener onChildClickListener = new ExpandableListView.OnChildClickListener() {
        @Override
        public boolean onChildClick(ExpandableListView expandableListView, View view, int i, int i1, long l) {
            return false;
        }
    };
}
